package org.domain.pseample.session;

import java.util.List;
import java.util.ArrayList;

import org.apache.log4j.Logger;

public class ConferenceCenter {

	private static Logger logger = Logger.getLogger(ConferenceCenter.class);
	private String admin;
	private String conferenceEndPoint;
	private List<String> conferenceMembersList;

	public void setAdmin(String admin) {
		this.admin = admin;
	}

	public String getAdmin() {
		return admin;
	}

	public void setConferenceEndPoint(String conferenceEndPoint) {
		this.conferenceEndPoint = conferenceEndPoint;
	}

	public String getConferenceEndPoint() {
		return conferenceEndPoint;
	}

	public void createConferenceMembersList() {
		conferenceMembersList = new ArrayList<String>();
	}

	public void addConferenceMember(String member) {
		conferenceMembersList.add(member);
		logger.info(member + " added to List");
	}

	public boolean checkConferenceUser(String member) {
		for (String temp : conferenceMembersList) {
			if (temp.equals(member)) {
				logger.info("EXISTS");
				return true;
			}
		}
		return false;
	}

	public void removeConferenceUser(String user) {
		conferenceMembersList.remove(user);
	}

	public List<String> getConferenceMembersList() {
		return conferenceMembersList;
	}
}
